package me.zhengjie.business.service.impl;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.business.domain.vo.Kc21Vo;
import me.zhengjie.business.repository.Kc21Repository;
import me.zhengjie.business.service.dto.Kc21QueryCriteria;
import me.zhengjie.business.service.Kc21Service;
import me.zhengjie.utils.PageUtil;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @description 服务实现
 * @author xiahongbo
 * @date 2023-04-24
 **/
@Slf4j
@Service
@RequiredArgsConstructor
public class Kc21ServiceImpl implements Kc21Service {

    private final Kc21Repository kc21Repository;

    @Override
    public Map<String, Object> queryKc21VoPageList(Kc21QueryCriteria criteria, Pageable pageable) {
        Page<Kc21Vo> page = kc21Repository.queryKc21VoPageList(criteria.getAkb020(), criteria.getAkc190(), criteria.getAac008(), criteria.getAab034(), criteria.getRyxx(), pageable);
        return PageUtil.toPage(page);
    }

    @Override
    public List<Kc21Vo> queryKc21VoAllList(Kc21QueryCriteria criteria) {
        return kc21Repository.queryKc21VoAllList(criteria.getAkb020(), criteria.getAkc190(), criteria.getAac008(), criteria.getAab034(), criteria.getRyxx());
    }

    @Override
    public void download(List<Kc21Vo> all, HttpServletResponse response) throws IOException {

    }
}
